package smashedapples.forms
{
	import mx.controls.TextInput;

	public class TextInput extends mx.controls.TextInput implements IFormControl
	{
		public function TextInput()
		{
			super();
			this.percentWidth = 100;
		}

		private var _cInclude:Boolean = true;

		[Inspectable( enumeration="true,false",defaultValue="true" )]
		public function get cInclude():Boolean
		{
			return _cInclude;
		}

		public function set cInclude( value:Boolean ):void
		{
			_cInclude = value;
		}

		public function cReset():void
		{
			this.cValue = this.cDefault;
		}

		// represents the property that holds the value in the control
		private var _cProperty:String = "text";

		public function get cProperty():String
		{
			return _cProperty;
		}

		public function set cProperty( value:String ):void
		{
			_cProperty = value;
		}


		// represents the key (field name) of the data, by default we use the controls id.
		private var _cName:String;

		public function get cName():String
		{
			if( _cName != null )
				return _cName;
			return this.id as String;
		}

		public function set cName( value:String ):void
		{
			_cName = value;
		}


		public function get cValue():*
		{
			return this[ cProperty ];
		}

		public function set cValue( value:* ):void
		{
			this[ cProperty ] = value;
		}

		private var _cDefault:String = "";

		public function get cDefault():*
		{
			return this._cDefault;
		}

		public function set cDefault( value:* ):void
		{
			cDefault = value;
		}


		private var _cCache:Boolean = false;

		public function get cCache():Boolean
		{
			return _cCache;
		}

		public function set cCache( value:Boolean ):void
		{
			_cCache = value;
		}

	}
}